<template>
  <div>
    <el-card style="width: 100%">
      车型编号：<el-input style="width: 300px" placeholder="请输入车型编号">
      </el-input>
        应载重量：<el-select v-model="value" placeholder="请选择应载重量">
          <el-option
            v-for="(item, index) in weightOption"
            :key="index"
            :label="item.label"
            :value="item.value"
          ></el-option>
        </el-select>
        应载体积：<el-select v-model="value" placeholder="请选择应载体积">
          <el-option
            v-for="(item, index) in sizeOption"
            :key="index"
            :label="item.label"
            :value="item.value"
          ></el-option>
        </el-select>
      车辆类型：<el-input
        style="width: 300px; margin-right: 150px"
        placeholder="请输入车辆类型"
      ></el-input>
      <el-button type="danger" size="large">搜索</el-button>
      <el-button size="large">重置</el-button>
    </el-card>
    <!-- 列表区域 -->
    <el-card style="margin-top: 30px">
      <el-button type="primary" style="margin-bottom: 20px">新增车辆</el-button>
      <el-table
        :data="carList"
        stripe
        style="width: 100%"
        border
        v-loading="loading"
      >
        <el-table-column align="center" type='index'  label="序号">
        </el-table-column>
        <el-table-column align="center" prop="id" label="车牌编号">
        </el-table-column>
        <el-table-column align="center" prop="name" label="车辆类型">
        </el-table-column>
        <el-table-column align="center" prop="num" label="车辆数量">
        </el-table-column>
        <el-table-column align="center" prop="allowableLoad" label="应载重量">
        </el-table-column>
        <el-table-column   align="center"   prop="allowableVolume"   label="应载体积">
        </el-table-column>
        <el-table-column align="center" prop="measureLong" label="长">
        </el-table-column>
        <el-table-column   align="center"   prop="measureWidth"    label="宽"  >
        </el-table-column>

        <el-table-column align="center" prop="measureHigh" label="高">

        </el-table-column>

        <el-table-column align="center" width="300" label="操作">
          <template>
            <el-row>
              <el-link  style="color: #419eff">查看详情  </el-link>
              <el-link  style="color: #419eff">启用  </el-link>
              <el-link style="color: #419eff">配置司机</el-link>
            </el-row>
          </template>
        </el-table-column>
      </el-table>
    </el-card>
  </div>
</template>

<script>
import { getCarListApi } from "@/api/car";
export default {
  name: "cartListPage",
  data() {
    return {
      page: {
        page: 1,
        pageSize: 10,
      },
      carList:[]
    };
  },
  created() {
    this.getCarListApi();
  },
  methods: {
    async getCarListApi() {
      const res = await getCarListApi(this.page);
      this.carList = res.data.items
      console.log(res);
    },
  },
};
</script>

<style lang="scss" scoped>
.tabs {
  height: 48px;
  width: 120px;
  text-align: center;
  line-height: 48px;
  cursor: pointer;
}
.defaultImg {
  width: 133px;
  margin: 0 auto;
}
</style>
